
/*
 * @Descripttion: 
 * @version: 
 * @Author: by
 * @Date: 2021-08-13 16:34:01
 * @LastEditors: tc
 * @LastEditTime: 2022-01-07 15:18:37
 */
import request from '../utils/request'

const adminApi = {}

// 账号密码登录
adminApi.login = (params) => {
    return request({
        url: '/web/auth/login',
        method: 'post',
        params
    })
}
// 手机验证码登录
adminApi.loginByyzm = (params) => {
    return request({
        url: '/web/auth/codeLogin',
        method: 'post',
        params
    })
}
// 退出登录
adminApi.logout = () => {
    return request({
        url: '/web/auth/logout',
        method: 'post',
        params: {}
    })
}

// 修改密码
adminApi.changePwd = (params) => {
    return request({
        url: '/web/auth/changePwd',
        method: 'post',
        params
    })
}

// 发送验证码
adminApi.sendCode = (params) => {
    return request({
        url: '/phone/sendCode',
        method: 'post',
        params
    })
}
// 生成随机验证码

adminApi.getCode = (params) => {
    return request({
        url: '/web/auth/randomCode',
        method: 'post',
        params,
        responseType: 'arraybuffer'
    })
}
// 忘记密码
adminApi.resetPassword = (params) => {
    return request({
        url: '/web/auth/forgetPwd',
        method: 'post',
        params
    })
}
export default adminApi